Repository navigation
tests: define TA_ASSERT_POLICY before unit_test_config.h tests it - #599
Merged
Merged
Conversation
… unit_test_config.h
The policy was tested before anything defined it, so TA_ASSERT_POLICY == TA_ASSERT_THROW compared
0 == 0 and BOOST_{WARN,CHECK,REQUIRE}_TA_ASSERT expanded to BOOST_*_THROW under every policy; with
TA_ASSERT_IGNORE/ABORT, conversions_suite/concat failed 4 checks. Also #error if the policy is undefined.
evaleev
force-pushed
the
fix/unit-test-assert-policy
branch
from
October 28, 2026 20:41
121bf30 to
6470522
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/unit_test_config.htestsTA_ASSERT_POLICY == TA_ASSERT_THROWbefore anything has includedTiledArray/config.h. Both macros are undefined at that point, so the condition is0 == 0and always true. As a result,BOOST_{WARN,CHECK,REQUIRE}_TA_ASSERTexpand toBOOST_*_THROWunder every policy, not just THROW.CI always configures with
TA_ASSERT_THROW, so it never notices. A default build (TA_ASSERT_IGNORE) failsconversions_suite/concatwith 4 checks of "exception TiledArray::Exception expected but not raised". Those asserts are compiled out, so the expected exception is never thrown.The fix includes
TiledArray/config.hbefore the test. It also adds an#errorif the policy macros are still undefined there, so the check can't silently pass again.Verified locally (macOS, AppleClang, Release):
TA_ASSERT_IGNORE:conversions_suite/concatfails 4 checks.TA_ASSERT_IGNORE:check-tiledarraypasses, including np=1 and np=2.TA_ASSERT_THROW:check-tiledarraypasses, including np=1 and np=2.Found while verifying #598.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VUXmaqVr5HVkrMw6ivrKzF